﻿<%@ Page Language="C#" MasterPageFile="~/Home/HomePage.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="Home_Default" %>

<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>
<asp:Content ID="Head" ContentPlaceHolderID="Head" runat="Server">
    <title>我的点客</title>
    <link href="/style/index.css" type="text/css" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="Server">
    <script type="text/javascript">
var pagesize=<%=PageSize %>;

    </script>
    <script type="text/javascript" src="/home/js/default.js"></script>
    <div id="bulkRight">
        <div class="titleSix">
            我的点客</div>
        <div class="orderInfor">
            <div class="logintitle">
            <a name="top"></a>
            </div>
            <table border="0" cellpadding="0" cellspacing="0" class="orderstable">
                <thead>
                    <tr class="orderhead orderTr">
                        <td class="orderTdOne">
                            订单编号
                        </td>
                        <td class="orderTdOne">
                            订单商品
                        </td>
                        <td class="orderTdOne">
                            收货人
                        </td>
                        <td class="orderTdOne">
                            订单金额
                        </td>
                        <td class="orderTdOne">
                            下单时间
                        </td>
                        <td class="orderTdOne">
                            订单状态
                        </td>
                        <td class="orderTdOne">
                            操作
                        </td>
                    </tr>
                </thead>
                <tbody class="tbody">
                    <%
                        if (_orderList != null && _orderList.Count > 0)
                        {
                            for (int i = 0; i < _orderList.Count; i++)
                            {
                           
                     
                    %>
                    <tr class="orderTr">
                        <td class="orderTdTwo">
                            <%=_orderList[i].Order.OrderID%>
                        </td>
                        <td class="orderTdTwo">
                            <%
                                for (int j = 0; j < _orderList[i].Lines.Count; j++)
                                {
                                    Response.Write(_orderList[i].Lines[j].GoodsName);
                                }
                            %>
                        </td>
                        <td class="orderTdTwo">
                            <%=_orderList[i].Order.ReceiverName%>
                        </td>
                        <td class="orderTdTwo">
                            <%=_orderList[i].Order.TotalAmount.ToString("C2")%>
                        </td>
                        <td class="orderTdTwo">
                            <%=_orderList[i].Order.OrderDate.ToString("yyyy-MM-dd HH:mm:ss")%>
                        </td>
                        <td class="orderTdTwo">
                            <%=_orderList[i].Order.OrderStatus%>
                        </td>
                        <td class="orderTdTwo">
                            <a href='/home/orderreview.aspx?orderid=<%=_orderList[i].Order.OrderID %>'>【查看】</a>
                            <a href="pay/alipay.aspx?orderid=<%=_orderList[i].Order.OrderID %>">【付款】</a>
                            <%if (_orderList[i].Order.OrderStatus == "未付款")
                              {%>| <a href="">【付款】</a><%} %>
                        </td>
                    </tr>
                    <%
                        }
                        //加载分页
                        //if (asPage.TotalCount > PageSize * (0 + 1))
                        {
                            var totalPage = asPage.TotalCount % PageSize == 0 ? asPage.TotalCount / PageSize : (asPage.TotalCount / PageSize + 1);
                            Response.Write("<tr class='orderTr'><td colspan='7'  class='orderTdTwo' align='right'><a href='javascript:void(0)' onclick='goPage(" + (asPage.CurPage - 1 > 0 ? asPage.CurPage - 1 : asPage.CurPage) + ");'>上一页</a> <a href='javascript:void(0)' onclick='goPage(" + (asPage.CurPage + 1 > totalPage ? totalPage : (asPage.CurPage + 1)) + ");'>下一页</a></td></tr>");
                        }
                    }
                    else
                    {%>
                    <tr class="orderTr">
                        <td colspan="7" align="center" class="orderTdTwo">
                            [ 您还没有买过任何商品呢 ]
                        </td>
                    </tr>
                    <%
                        } %>
                </tbody>
            </table>
        </div>
</asp:Content>
